<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="/resource/js/jquery-3.2.1.js"></script>
<script type="text/javascript" src="/resource/js/bootstrap.js"></script>
<link rel="stylesheet" href="/resource/css/bootstrap.css">
<style type="text/css">
	img {
		max-width: 450px;
	}
	a:visited {
	 color: #000000;
	 text-decoration: none;
	}
	a:linked {
	 color: #000000;
	 text-decoration: none;
	}
	
</style>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	
	<ul class="list-unstyled">
		<c:forEach items="${info.list}" var="c">
			<li class="media">
				
				<a href="${c.url }">
					${c.text }<br>
					收藏时间：<fmt:formatDate value="${c.created }" pattern="yyyy-MM-dd HH:mm:ss"/> 
				</a>
					<input type="button" onclick="del(${c.id})" value="删除"  class="btn btn-sm btn-info"> 
				
			</li>
			<hr>
		</c:forEach>
	</ul>
	
	<jsp:include page="/WEB-INF/view/common/pages.jsp"></jsp:include>
	
	
	
</div>
</body>
<script type="text/javascript">
	//分页的方法
	function goPage(pageNum){
		/* location="/my/articles?pageNum="+pageNum; */
		
		//直接在中央展示区，加载数据
		$("#center").load("/my/collect?pageNum="+pageNum);
	}
	
	//删除
	function del(id){
		//调用ajax从后台删除数据
		$.post(
			"/my/delCollect",
			{id:id},
			function(result){
				if(result){
					window.location.reload();
				}
			}
		)
		
	}
</script>
</html>